<%@page language="java" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script type="text/javascript">
	$(document).ready(function() {
		$('.pointout span').on('click', function() {
			$(".pointout").hide();
		});
	});
	function submitFormPwd() {
		$("#pwdvalidInfo").text("");
		var authorOldPassword = $.trim($("#authorOldPassword").val());
		var authorPassword = $.trim($("#authorPassword").val());
		var authorPasswordAgain = $.trim($("#authorPasswordAgain").val());
		if (authorOldPassword != "" && authorPassword != ""
				&& authorPasswordAgain != "") {
			if (authorPassword.length < 6) {
				$("#pwdvalidInfo").text("密码至少大于等于6位");
				return;
			}
			var patrn = /^([a-zA-Z0-9]|[._]){6,20}$/;
			if (!patrn.exec(authorPassword)) {
				$("#pwdvalidInfo").text("密码只能由数字和字母（6-20位）组成");
				return false;
			}
			if (authorPassword != authorPasswordAgain) {
				$("#pwdvalidInfo").text("两次密码输入不一致!");
				return false;
			} else {
				$.post($("#pwdform").attr("action"), $("#pwdform").serialize(),
						function(data) {
							var result = $.parseJSON(data);
							if (result.code == 0) {
								alert("登录密码更新成功！");
								window.location.href = result.url;
							} else {
								$("#pwdvalidInfo").text(result.message);
								$("#authorOldPassword").val("");
								return false;
							}
						});
			}
		} else {
			$("#pwdvalidInfo").text("请将信息填写完整!");
			return false;
		}
	}
</script>
<style>
.pointout {
	width: 1180px;
	margin: 0 auto;
	margin-bottom: -34px;
	line-height: 60px;
	color: orange;
	position: relative;
}

.pointout span {
	position: absolute;
	top: 4px;
	right: 0px;
	line-height: 0px;
	cursor: pointer;
}

.pointout span img {
	width: 16px;
}
</style>
<div class="top">
	<div class="topn">
		<b><a><img src="<%=path%>/image/logotop2.png" /></a></b>
		<ul class="ulTop">
			<li class="notice"><a href="#">通知</a></li>
			<li class="head" ng-click="toggleMenu()">${readerAuthor.authorAccount}
				<dl ng-show='menuState.show'>
					<div>
						<a href="<%=path%>/author/info">编辑作家资料</a>
<%-- 						<a href="<%=path%>/author/info">作家资料<span>69%</span></a> --%>
					</div>
					<dd>
						<a class="change">更改密码</a>
					</dd>
					<dd>
						<a href="<%=path%>/author/logout" class="out">退出登录</a>
					</dd>
				</dl>
			</li>
		</ul>
	</div>
</div>
<div class="pointout">
	提示：上传新章节的时候请注意排版，头文字不用缩进，段落要回车换行，如使用中遇到问题请点击联系客服中心，我们将第一时间为您解决！ <span><img
		src="<%=path%>/image/close.png" /></span>
</div>

<!--更改密码-->
<div class="managepass">
	<form action="<%=path%>/author/pwdSave" name="pwdform" id="pwdform"
		method="post">
		<div class="changepass">
			更改登录密码<img src="<%=path%>/image/cdel.png" />
		</div>
		<ul>
			<li><b>原密码</b></li>
			<li><input type="password" id="authorOldPassword"
				name="authorOldPassword" maxlength="20" /></li>
			<li><b>新密码</b></li>
			<li><input type="password" id="authorPassword"
				name="authorPassword" maxlength="20" /></li>
			<li><span>密码只能由数字和字母（6-20位）组成</span></li>
			<li><b>再次输入新密码</b></li>
			<li><input type="password" id="authorPasswordAgain"
				name="authorPasswordAgain" maxlength="20" /></li>
			<li><span id="pwdvalidInfo" style="color: red;"></span></li>
			<li><a onclick="submitFormPwd();return false;">提 交</a></li>
		</ul>
	</form>
</div>
<!--更改密码-->
</html>